package com.qqt.csr.archive.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qqt.csr.archive.entity.reader.CsrSkillSetConfig;
import com.qqt.csr.archive.mapper.CsrSkillSetConfigMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * @Author: yang hao
 * @Date: 2024/11/28 11:45
 * @Description: 技能组配置
 **/
@Slf4j
@Service
public class CsrSkillSetConfigService extends ServiceImpl<CsrSkillSetConfigMapper, CsrSkillSetConfig> {

    /**
     * 根据技能组id获取技能组配置
     * @param skillSetId {@link Long} 技能组id
     * @return {@link CsrSkillSetConfig} 技能组配置
     */
    public CsrSkillSetConfig getBySkillSetId(Long skillSetId) {
        LambdaQueryWrapper<CsrSkillSetConfig> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Objects.nonNull(skillSetId), CsrSkillSetConfig::getSkillSetId, skillSetId);
        return getOne(wrapper);
    }

}
